package com.duqc.designpattern.responsibility;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ClassName WebInterceptorConfig
 * @Description TODO
 * @Author duqc
 * @Date 2021/5/7
 **/
@Component
public class WebInterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //先注册关键字拦截器，拦截所有请求
//        registry.addInterceptor(new WordInterceptor()).addPathPatterns("/**");
        //再注册登录拦截器，拦截所有请求
//        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**");
    }
}
